package org.example;

import java.util.ArrayList;
import java.util.Arrays;

public class test01 {

    //定义一个stude
    public static void main(String[] args) {
        System.out.println("hello");

//1.添加
        ArrayList<String> c = new ArrayList<>();
        c.add("a1");
        c.add("a1");
        c.add("a1");
        c.add("a1");
        System.out.println(c);
        //2.清空
        c.clear();
        System.out.println(c);
//        3.是否为空
        System.out.println(c.isEmpty());
        //4.大小
        System.out.println(c.size());
        //5.转换为数组
        c.add("11");
        c.add("11");
        c.add("11");
        c.add("11");
        Object[] arr = c.toArray();
        System.out.println(Arrays.toString(arr));

    }
}
